***** Replication code for Franchino, Fabio, and Camilla Mariotto. “Noncompliance Risk, Asymmetric Power and the Design of Enforcement of the European Economic Governance”. European Union Politics.

***** Online Appendix Section 3.5 Alternative proxies of noncompliance risk
* Table A8: Governmental positions on national discretion and enforcement regimes: an alternative proxy for risk
version 15
pause on
use conflict_data_FC2.dta, clear

* Generalized structural equation model: Three-levels, Random intercepts
gsem (discr_com <- c.edp_3 c.nbi c.nbi#c.edp_3 i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.edp_3 c.nbi c.nbi#c.edp_3 i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.edp_3                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) nolog

pause /* type q to proceed to marginal effects figure */
	 
** Substantive effects: Council Discretion
* Code from Thomas Brambor, William Roberts Clark, Matt Golder, Political Analysis 14: 63-82)
matrix b=e(b)
matrix list b
scalar b17=b[1,17]
scalar b19=b[1,19]
sca dir
matrix V=e(V)
matrix list V
scalar varb17=V[17,17]
scalar varb19=V[19,19]
scalar covb17b19=V[17,19]
sca dir
generate MVZ=(_n+8)/10
replace  MVZ=. if _n>123
gen conbx=b17+b19*MVZ if _n<=123
gen consx=sqrt(varb17+varb19*(MVZ^2)+2*covb17b19*MVZ) if _n<=123
gen ax=1.96*consx
gen upperx=conbx+ax
gen lowerx=conbx-ax
gen where= -1.4 
gen pipe = "|" 
egen tag_nbi = tag(nbi)
gen yline=0
graph twoway hist nbi, width(0.5) percent color(gs14) yaxis(2) ///
		|| scatter where nbi if tag_nbi, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off)  ///
		||   line conbx   MVZ, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1)  ///
        ||   line upperx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line lowerx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line yline  MVZ,  clwidth(thin) clcolor(black) clpattern(solid) || , ///
			 xlabel(1 5 10, noticks nogrid labsize(2)) xscale(noline) ylabel(-2 0 2 4 6, noticks axis(1) nogrid labsize(2))  ///
		     ylabel(0 5 10 15 20, noticks axis(2) nogrid labsize(2)) yscale(noline alt) yscale(noline alt axis(2)) legend(off) ///			 
			 title("" , size(2.5)) xtitle("Voting power (%)" , size(2.5)) ytitle("Marginal effect of {it:noncompliance risk}" , axis(1) size(2.5)) ytitle("" , axis(2) size(2.5)) ///
			 xsca(titlegap(2) r(0.3 1.5)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white))

pause /* type q to proceed to marginal effects figure */
			 
** Substantive effects: Commission Discretion
drop MVZ-yline
* Code from Thomas Brambor, William Roberts Clark, Matt Golder, Political Analysis 14: 63-82)
matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
generate MVZ=(_n+8)/10
replace  MVZ=. if _n>123
gen conbx=b1+b3*MVZ if _n<=123
gen consx=sqrt(varb1+varb3*(MVZ^2)+2*covb1b3*MVZ) if _n<=123
gen ax=1.96*consx
gen upperx=conbx+ax
gen lowerx=conbx-ax
gen where=-3.5 
gen pipe = "|" 
egen tag_nbi = tag(nbi)
gen yline=0
graph twoway hist nbi, width(0.5) percent color(gs14) yaxis(2) ///
		|| scatter where nbi if tag_nbi, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off)  ///
		||   line conbx   MVZ, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1)  ///
        ||   line upperx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line lowerx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line yline  MVZ,  clwidth(thin) clcolor(black) clpattern(solid) || , ///
			 xlabel(1 5 10, noticks nogrid labsize(2)) xscale(noline) ylabel(-2 0 2 4 6, noticks axis(1) nogrid labsize(2))  ///
		     ylabel(0 5 10 15 20, noticks axis(2) nogrid labsize(2)) yscale(noline alt) yscale(noline alt axis(2)) legend(off) ///			 
			 title(" " , size(2.5)) xtitle("Voting power" , size(2.5)) ytitle("Marginal effect of {it:noncompliance risk}" , axis(1) size(2.5)) ytitle("" , axis(2) size(2.5)) ///
			 xsca(titlegap(2) r(0.3 1.5)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white)) 
			 
